Prefer locate-user-emacs-file
authorStefan Kangas <stefan@marxist.se>
Tue, 9 Nov 2021 06:51:18 +0000 (07:51 +0100)
committerStefan Kangas <stefan@marxist.se>
Tue, 9 Nov 2021 06:51:27 +0000 (07:51 +0100)
* lisp/cmuscheme.el (scheme-start-file):
* lisp/erc/erc.el (erc-startup-file-list):
* lisp/net/nsm.el (nsm-settings-file):
* lisp/net/tramp-crypt.el (tramp-crypt-config-file-name):
* lisp/org/org-clock.el (org-clock-persist-file):
* lisp/org/org-id.el (org-id-locations-file)
* lisp/shell.el (shell): Prefer 'locate-user-emacs-file' to fiddling
with 'user-emacs-directory' directly.

lisp/cmuscheme.el
lisp/erc/erc.el
lisp/net/nsm.el
lisp/net/tramp-crypt.el
lisp/org/org-clock.el
lisp/org/org-id.el
lisp/shell.el

index e197069d6b8b0bfe9b602f85f4ca500401e08cbf..47113ad8c2e5fb354e6752a6cbb555186f9c6e23 100644 (file)
@@ -245,7 +245,8 @@ Search in the directories \"~\" and `user-emacs-directory',
 in this order.  Return nil if no start file found."
   (let* ((progname (file-name-nondirectory prog))
         (start-file (concat "~/.emacs_" progname))
-        (alt-start-file (concat user-emacs-directory "init_" progname ".scm")))
+         (alt-start-file (locate-user-emacs-file
+                          (concat "init_" progname ".scm"))))
     (if (file-exists-p start-file)
         start-file
       (and (file-exists-p alt-start-file) alt-start-file))))
index 8e2bb833605b3fda5e1d9627f7e34880aac1be82..30285687536c95109b315241aad00d0ffe22d9a2 100644 (file)
@@ -872,8 +872,8 @@ See `erc-server-flood-margin' for other flood-related parameters.")
 ;; Script parameters
 
 (defcustom erc-startup-file-list
-  (list (concat user-emacs-directory ".ercrc.el")
-        (concat user-emacs-directory ".ercrc")
+  (list (locate-user-emacs-file ".ercrc.el")
+        (locate-user-emacs-file ".ercrc")
         "~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc")
   "List of files to try for a startup script.
 The first existent and readable one will get executed.
index 2ac1df1d58a16bf8961514d13928e608b4f78ced..b067b23f8ff5f913eee5f331f11faec8df738e86 100644 (file)
@@ -79,8 +79,7 @@ option."
                  (const :tag "Off" nil)
                  (function :tag "Custom function")))
 
-(defcustom nsm-settings-file (expand-file-name "network-security.data"
-                                                user-emacs-directory)
+(defcustom nsm-settings-file (locate-user-emacs-file "network-security.data")
   "The file the security manager settings will be stored in."
   :version "25.1"
   :type 'file)
index 5def3a4137c11972704ac0867b9422dee32e19e0..269560bfa9458170e6cef80eb15acfaf43128d87 100644 (file)
@@ -293,9 +293,8 @@ arguments to pass to the OPERATION."
 
 (defun tramp-crypt-config-file-name (vec)
   "Return the encfs config file name for VEC."
-  (expand-file-name
-   (concat "tramp-" (tramp-file-name-host vec) tramp-crypt-encfs-config)
-   user-emacs-directory))
+  (locate-user-emacs-file
+   (concat "tramp-" (tramp-file-name-host vec) tramp-crypt-encfs-config)))
 
 (defun tramp-crypt-maybe-open-connection (vec)
   "Maybe open a connection VEC.
index 143ed4f123a472f2dc3cdd51794d6db9f30ad065..12a4c2b7b71ffb440bfd964225252defba2225c8 100644 (file)
@@ -219,8 +219,7 @@ Emacs initialization file."
          (const :tag "Clock and history" t)
          (const :tag "No persistence" nil)))
 
-(defcustom org-clock-persist-file (convert-standard-filename
-                                  (concat user-emacs-directory "org-clock-save.el"))
+(defcustom org-clock-persist-file (locate-user-emacs-file "org-clock-save.el")
   "File to save clock data to."
   :group 'org-clock
   :type 'string)
index 56783d10833bbb1e69464f022c98a30d98248e8d..bd7e73905f366b68b85f488330f8818f4de59f7f 100644 (file)
@@ -196,8 +196,7 @@ the link."
   :group 'org-id
   :type 'boolean)
 
-(defcustom org-id-locations-file (convert-standard-filename
-                                 (concat user-emacs-directory ".org-id-locations"))
+(defcustom org-id-locations-file (locate-user-emacs-file ".org-id-locations")
   "The file for remembering in which file an ID was defined.
 This variable is only relevant when `org-id-track-globally' is set."
   :group 'org-id
index cb4afe6dea8e97e26d3bd5d654d646f32ace5010..370532ea46f279a8a8512707c1ff3bd505c75c73 100644 (file)
@@ -785,7 +785,8 @@ Make the shell buffer the current buffer, and return it.
             (startfile (concat "~/.emacs_" name))
             (xargs-name (intern-soft (concat "explicit-" name "-args"))))
        (unless (file-exists-p startfile)
-         (setq startfile (concat user-emacs-directory "init_" name ".sh")))
+         (setq startfile (locate-user-emacs-file
+                          (concat "init_" name ".sh"))))
        (setq-local shell--start-prog (file-name-nondirectory prog))
        (apply #'make-comint-in-buffer "shell" buffer prog
               (if (file-exists-p startfile) startfile)